import request from '@/utils/request'

/*axios({
	url: window.getIps+'/4SCAFE/CafeActivitySystem/addCafeActivity.action',
	method: 'post',
	headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
	data: qs.stringify(obj)
})
.then(res => {
	console.log(res)
})
.catch(function (error) {
    console.log(error);
  });*/

export function loginByUsername(username, password) {
	const data = {
		username,
		password
	}
	return request({
		url: '/login/login',
		method: 'post',
		data
	})
}

export function logout() {
	return request({
		url: '/login/logout',
		method: 'post'
	})
}

export function getUserInfo(token) {
	return request({
		url: '/user/info',
		method: 'get',
		params: {
			token
		}
	})
}

//用户登录
export function login(obj) {
	return request({
		baseURL: window.getIps + '/4SCAFE/cafeUser/login.action',
		method: 'post',
		params: obj
	})
}

//首页
export function dashaborad(obj) {
	return request({
		baseURL: window.getIps + '/4SCAFE/back/statistics/homeStatistics.action',
		method: 'post',
		params: obj
	})
}